// SPDX-License-Identifier: GPL-2.0
/*
 * CPP: CLASS INHERITANCE
 *
 * (C) 2024.05.23 BiscuitOS <buddy.zhang@aliyun.com>
 */
#include <iostream>
#include <string.h>

/* BASIC CLASS */
class PERSON {
public:
	/* ATTRIBUTE */
	std::string name;
	int age;

	/* CONSTRUCTOR */
	PERSON(std::string n, int a) : name(n), age(a) {}

	/* METHOD */
	void show() {
		std::cout << "NAME: " << name << ", AGE: " << age << std::endl;
	}
};

/* INHERITANCE CLASS */
class STUDENT : public PERSON {
public:
	/* ATTRIBUTE */
	std::string school;

	/* CONSTRUCTOR */
	STUDENT(std::string n, int a, std::string sc) : PERSON(n, a), school(sc) {}

	/* METHOD */
	void show() {
		PERSON::show();
		std::cout << "SCHOOL: " << school << std::endl;
	}
};

int main(void)
{
	/* CREATE OBJECT */
	STUDENT std = STUDENT("BiscuitOS", 8, "GITHUB");

	/* INVOKE METHOD */
	std.show();

	return 0;
}
